<?php
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.modelitem');


class HolaMundoModelHolaMundo extends JModelItem{
	
	protected $msg;
	
	public function getTable($type = 'HolaMundo', $prefix = 'HolaMundoTable', $config = array()) 
	{
		return JTable::getInstance($type, $prefix, $config);
	}
	
	
	public function getMsg(){
		if (!isset($this->msg)){
			
			$id = JRequest::getInt('id');
			
			$table = $this->getTable();
			
			$table->load($id);
			
			$this->msg = $table->saludo;
		}
		return $this->msg;
	}
}
